const path = require('path');
const isDev = think.env === 'development';
const middle=require('../common/middleware/middleware');
module.exports = [

    {
        handle: 'meta',
        options: {
            logRequest: isDev,
            sendResponseTime: isDev,

        }
    },
    {
        handle: 'resource',
        enable: true,
        options: {
            root: '.',
            publicPath: '/uploads/imgs/'
        }
    },
    {
        handle: 'trace',
        enable: !think.isCli,
        options: {
            debug: isDev,
            contentType:'json'
        }
    },
    {
        handle: 'payload',
        options: {
            uploadDir:path.join(think.ROOT_PATH, 'runtime','temp'),
            extendTypes: {
            }
        }
    },
    {
        handle: 'router',
        options: {
            defaultModule: '',
            defaultController: '',
            defaultAction: '',
            suffix: [],
            enableDefaultRouter: false,
            subdomainOffset: 2,
            subdomain: {},
            denyModules: []
        }
    }, {
        handle:middle,
        options:{
            open:true,
        }
    },
    // 'logic',
    'controller'
];
